import Vue from 'vue'
import Router from 'vue-router'
/*
vue 页面跳转的规则 具体内容查看https://rou ter.vuejs.org/zh/
Layout为父级页面
children中的为加载功能页面
 */
Vue.use(Router);
import Login from '@/components/Login'
import Error from '@/components/Error'
export default new Router({
  mode: 'history',
  routes: [
    /*    {
          path: '/home',
          name: 'opc',
          redirect: '/home/index',
          component: Layout,
          children: [
            {
              path: 'index',
              name: 'Home',
              component: () => import('@/views/home/index')
            }
          ]
        },
        {
          path: '/mobile/home/',
          name: 'mobileHome',
          component: Layout,
          children: [
            {
              path: 'index',
              name: 'mobilePLC',
              component: () => import('@/views/mobile/home/index')
            }
          ]
        },
        {
          path: '/enterprise',
          name: 'enterprise',
          redirect: '/enterprise/index',
          component: Layout,
          children: [
            {
              path: 'index',
              name: 'Enterprise',
              component: () => import('@/views/enterprise/index')
            },
            {
              path: 'plcDeviceList',
              name: 'plcDeviceList',
              component: () => import('@/views/enterprise/plcDeviceList')
            },
            {
              path: 'plcPointList',
              name: 'plcPointList',
              component: () => import('@/views/enterprise/plcPointList')
            }
          ]
        },
        {
          path: '/userConfig',
          redirect: '/userConfig/index',
          name: 'userConfig',
          component: Layout,
          children: [
            {
              path: 'index',
              name: 'user',
              component: () => import('@/views/userConfig/index')
            },
            {
              path: 'deviceList',
              name: 'deviceList',
              component: () => import('@/views/userConfig/deviceList')
            },
            {
              path: 'pointList',
              name: 'pointList',
              component: () => import('@/views/userConfig/pointList')
            }
          ]
        },
        {
          path: '/config',
          redirect: '/config/index',
          component: Layout,
          children: [{
            path: 'index',
            name: 'Config',
            component: () => import('@/views/config/index')
          },
            {
              path: 'pointConfig',
              name: 'PointConfig',
              component: () => import('@/views/config/PointConfig')
            }]
        },
        {
          path: '/work',
          component: Layout,
          children: [{
            path: 'test1',
            name: 'test1',
            component: () => import('@/views/work/test1')
          }]
        },*/
    {
      path: '/login',
      name: '',
      component: Login
    },
    {
      path: '/error',
      name: 'ErrorPage',
      component: Error
    }
  ]
})
